package StringStudy;

public class StringLearn2 {
    public static void main(String[] args) {
        String str1 = "abcde";
        String str2 = "abcde";
        //1.证明abcde只有一份 true
        System.out.println("str1==str2 = " + (str1 == str2));
        str2 = str2.replace("abc", "999");
        System.out.println("str2 =str1 " + (str2 == str1));//true
        //2
        StringBuffer stringBuffer = new StringBuffer("acxyzabc");
        StringBuffer replace = stringBuffer.replace(1, 3, "99");
        System.out.println("replace==stringBuffer = " + (replace == stringBuffer));
        System.out.println("replace = " + replace);
        //逆转reverse
        StringBuffer reverse = replace.reverse();
        System.out.println("reverse = " + reverse);
    }
}
